package com.chinacache.maint.workorder.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.chinacache.maint.commons.entity.BaseEntity;

@Entity
@Table(name = "WO_FLOW_FILEDATT")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class FlowFieldAttribute extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String value;
	private FieldAttribute fieldAttribute;
	private Flow flow;
	private WorkOrderStep workOrderStep;
	private Integer groupId;

	@ManyToOne
	@JoinColumn(name = "WORKORDER_STEP_ID")
	public WorkOrderStep getWorkOrderStep() {
		return workOrderStep;
	}

	public void setWorkOrderStep(WorkOrderStep workOrderStep) {
		this.workOrderStep = workOrderStep;
	}

	@Id
	@Column(name = "FLOW_FIELD_ATT_ID")
	@GeneratedValue(generator = "SEQ_RPT_USER_TO_CLASS")
	@GenericGenerator(name = "SEQ_RPT_USER_TO_CLASS", strategy = "seqhilo", parameters = { @Parameter(name = "sequence", value = "SEQ_RPT_USER_TO_CLASS") })
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "VALUE")
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@ManyToOne
	@JoinColumn(name = "FIELD_ATT_ID")
	public FieldAttribute getFieldAttribute() {
		return fieldAttribute;
	}

	public void setFieldAttribute(FieldAttribute fieldAttribute) {
		this.fieldAttribute = fieldAttribute;
	}

	@ManyToOne
	@JoinColumn(name = "FLOW_ID")
	public Flow getFlow() {
		return flow;
	}

	public void setFlow(Flow flow) {
		this.flow = flow;
	}

	@Column(name = "GROUPID")
	public Integer getGroupId() {
		return groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}
}
